﻿using System;
using System.Data;
using System.IO;
using Microsoft.Data.Sqlite;
using ZilLion.Service.Core.ConfigManager.Manager;
using ZilLion.Service.Core.DapperWrapper;

namespace ZilLion.Service.TaskPlatform.Domain
{
    public class TaskRunnerSqliteContext : IDbContext
    {
        public IDbConnection GetConnection()
        {
           
            var builder = new SqliteConnectionStringBuilder
            {
                DataSource =
                    Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TaskManagerConfig.db")
            };
            return new SqliteConnection(builder.ToString());
        }

        public string ContextName => "TaskRunnerSqliteContext";
    }
}